

<?php

  

  require_once('./system/dbConnect.php');

  require_once('./system/MyFunc.php');

  //连接数据库		

  connect();



  if(!empty($_FILES["pic"]["name"])){

  	$pic = uploadfile('pic','images/',array('jpg','gif','png'));

  }

  else{

  	$pic='';

  }

  $data = array(
    'videoname' => trim($_POST['videoname']),  
    'tid' => $_POST['tid'],  
    'pic' => $pic,
    'intro' => $_POST['intro'],
    'uploaddate' => $_POST['uploaddate'],
    'uploadadmin' => $_POST['uploadadmin'],
    'hittimes' => $_POST['hittimes'],
    'downtimes' => $_POST['downtimes'],
    'address' => $_POST['address']
    );

  //执行SQL语句

	$result = add('videos',$data);



  if(!$result){

  	echo "添加失败！<br/>";

  	echo "<a href='videoForm.html'>返回</a>";	  

  }else{	  

 	echo "添加成功！";

 	echo "请使用<a href='./video-list.php'>视频列表</a>查看视频信息，";

  }    

  

?>



